package com.example.databindingdemo;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;

import com.example.databindingdemo.bean.Book;
import com.example.databindingdemo.databinding.ActivitySimpledatabindingBinding;

public class SimpleDataBindingActivity extends AppCompatActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivitySimpledatabindingBinding activitySimpledatabindingBinding = DataBindingUtil.setContentView(this,R.layout.activity_simpledatabinding);
        activitySimpledatabindingBinding.setBook(new Book("《斗罗大陆》"));
        activitySimpledatabindingBinding.setPrice(12);
    }
}
